<!--
 * @Description: 
 * @Version: 2.0
 * @Autor: zhangjx
 * @Date: 2023-05-29 14:55:07
 * @LastEditors: zhangjx
 * @LastEditTime: 2023-06-09 19:10:04
-->
<template>
	<div class="w-100">
		<el-steps :active="active" align-center>
			<el-step v-for="(item, index) in tabConfig" :key="index" :title="item.label" description="" />
		</el-steps>
		<div class="active-item mt10">
			<dictForm v-if="active == 1" :nowRowData="nowRowData" @refresh="onNext"></dictForm>
			<dictItem v-if="active == 2"></dictItem>
		</div>
	</div>
</template>

<script setup lang="ts">
import dictItem from './dictItem/index.vue'
import dictForm from './dictForm/index.vue'
const emit = defineEmits(['refresh'])

defineProps({
	api: Object,
	nowRowData: Object,
})

const active: any = ref(1)
watchEffect(() => {
	active.value = 1
})
const tabConfig = [
	{
		label: '字典信息',
		prop: 'base0',
	},
	{
		label: '配置字典项',
		prop: 'base1',
	},
]
const onNext = () => {
	emit('refresh')
	if (active.value++ > 1) active.value = 2
}
onMounted(() => {})
</script>

<style scoped></style>
